from math import *
a = int(input("   :"))
b = a % 10
c = a // 10 % 10
d = a // 100 % 10
e = a // 1000
if e == 0 or c > 9:
    print("   ")
else:
    print("   :", max(b,c,d,e))
    print("   :", min(b,c,d,e))
g = str(a).count("0")
if d == 0:
    print("   ")
else:
    print("  ", g)
if a % 2 == 0:
    x1 = ""
else:
    x1 = ""
print(" :", x1)
if a % 3 == 0:
    x2 = ""
else:
    x2 = ""
print("  3:",x2)
if a >= 0:
    if a == (sqrt(a)**2):
        print("   :",sqrt(a))
    else:
        print("     ")
else:
    print("     ")
if b == (sqrt(b)**2):
    print("      :",sqrt(b))
else:
    print("      : ")
if c == (sqrt(c)**2):
    print("      :",sqrt(c))
else:
    print("      : ")
if d == (sqrt(d)**2):
    print("      :",sqrt(d))
else:
    print("      : ")
if e == (sqrt(e)**2):
    print("      :",sqrt(g))
else:
    print("      : ")
